// pages/play/play.js
const app = getApp()
var api = require('../../utils/api.js')
var util = require('../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    list:[

    ]
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
  
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

     this.text();
    var list = [];
    list[0]={
      img: app.globalData.base_url +'images/play_01.png',
      but: 'hops'
    }
    list[1] = {
      img: app.globalData.base_url + 'images/play_02.png',
      but: 'party'
    }
    list[2] = {
      img: app.globalData.base_url + 'images/play_03.png',
      but: 'gift'
    }
    list[3] = {
      img: app.globalData.base_url + 'images/play_04.png',
      but: 'beg'
    }
    this.setData({
      list: list
    })
  },
  hops: function () {
    wx.navigateTo({
      url: '/play/pages/hops/hops'
    })
  },
  gift: function () {
    wx.navigateTo({
      url: '/play/pages/gift/gift'
    })
  },
  party: function () {
    wx.navigateTo({
      url: '/play/pages/party/party'
    })
  },
  beg: function () {
    wx.navigateTo({
      url: '/play/pages/beg/beg'
    })
  },
  onShareAppMessage: function () {

  },
  text:function(){
     api.POST({
        params: {},
        url: app.globalData.base_url + 'system/test',
        success: function (res) {

        },
        fail: function (fail) {
           util.showError("获取失败，请检查网络");
        }
     })
  }

})